package com.itheima.health.dao;

import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import java.util.Set;

/**
 * 权限
 */
@Mapper
public interface Permission {

    /**
     * 根据用户id查询权限关键字
     * @param userId 用户id
     */
    @Select("select keyword from t_permission where id in (select permission_id from t_role_permission where role_id in (select role_id from t_user_role where user_id = #{userId}))")
    Set<String> getKeywordByUserId(Integer userId);
}
